﻿using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using EasyAbp.Abp.Trees.EntityFrameworkCore;

namespace Joy.Erp.BasicArchives.EntityFrameworkCore;

[DependsOn(
    typeof(BasicArchivesDomainModule),
    typeof(AbpEntityFrameworkCoreModule),
    typeof(AbpSettingManagementEntityFrameworkCoreModule),
    typeof(AbpTreesEntityFrameworkCoreModule)
)]
public class BasicArchivesEntityFrameworkCoreModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        context.Services.AddAbpDbContext<BasicArchivesDbContext>(options =>
        {
            /* Add custom repositories here. Example:
             * options.AddRepository<Question, EfCoreQuestionRepository>();
             */
            options.AssemblyEntity(typeof(BasicArchivesEntityFrameworkCoreModule).Assembly);
        });

        // 注意：ABP 6.x 不支持 IBulkOperationProvider
        // 批量操作将在应用层直接使用 EFCore.BulkExtensions
    }
}
